#!/bin/bash

input_path="./assets/cai-xukun.mp4"
output_path="./outputs/"

# 进入脚本所在目录
cd "$(dirname "$0")"

# 激活虚拟环境
source venv/bin/activate

# 设置环境变量
export HF_HOME="./huggingface"
export XFORMERS_FORCE_DISABLE_TRITON="1"
#export PYTHONPATH="$PWD"

# 构造额外的参数列表
ext_args=()

if [ "$input_path" ]; then
    ext_args+=("-i=$input_path")
fi

if [ "$output_path" ]; then
    ext_args+=("-o=$output_path")
fi

# 执行 Python 脚本
HF_ENDPOINT=https://hf-mirror.com python "video_controlnet_aux/src/video_controlnet_aux.py" "${ext_args[@]}"
